package com.initialize.service.api.system.feign;


import com.baomidou.mybatisplus.extension.api.R;
import com.initialize.commom.config.path.ServiceApiConfig;
import com.initialize.commom.config.service.ServiceConfig;
import com.initialize.common.mybatis.plus.entity.User;
import com.initialize.core.feign.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * User Feign接口类
 *
 * @author Chill
 */
@FeignClient(
        name = ServiceConfig.SERVICE_SYSTEM,
        configuration = FeignConfiguration.class,
        fallback = IUserClientFallback.class
)
public interface IUserClient {

    /**
     * 获取用户信息
     *
     * @param id 用户id
     * @return
     */
    @GetMapping(ServiceApiConfig.USER_API_PREFIX + "/user-info/{id}")
    R<User> userInfo(@PathVariable Long id);

    /**
     * 获取用户信息
     *
     * @return
     */
    @PostMapping(ServiceApiConfig.USER_API_PREFIX + "/login")
    User login(@RequestBody String login);
}
